

jQuery(function($){
	//Define seller settings
	var UserID = "101toners";
	var StoreID = "101toners-Store";
	var ImgURL = "http://www.sunandfuninoc.com/sites/jx/0/101toners/ebay/";
	var settings = {
		"UserID":UserID,
		"loadingClass": "loading",
		"serviceUrl": "http://ebay.sunandfuninoc.com/ebay.php"
	};
	
	//Content Area Mods
	if(pageName == "PageAboutMeViewStore") {
		$(".pagecontainer > table:eq(1) tr:first td:first").addClass("x-bg");
		$(".x-bg > table:eq(0) tr:eq(0) td:first").addClass("x-ctr");
		$(".x-bg > table:eq(1) tr:eq(1) td:first").addClass("x-ctr");
		$(".x-ctr > table:eq(0)").addClass("x-ctr");
	}else {
		$(".pagecontainer > table:eq(1) tr:first td:first").addClass("x-bg");
		$(".x-bg table:eq(1)").addClass("x-content");
		$(".gallery table:eq(0)").removeClass("x-content");
		$("#x-template table:eq(1)").removeClass("x-content");
		$(".x-content tr:first").addClass("x-hide");
		$("#x-template .x-content tr:first").removeClass("x-hide");
		$(".x-content").find("br[clear = none]").remove();
	}
	
	//Store header
	var header = "\n\r<div id=\"x-head-wrap\"><div id=\"x-head\">" +
		"	<!-- head graphics -->" +
		"	<a id=\"x-head-logo\" href=\"http:\/\/stores.ebay.com\/"+StoreID+"\" title=\""+StoreID+" eBay Store\"><!-- sp --><\/a>" +
		"	<!-- head search -->" +
		"	<form id=\"x-head-srch\" method=\"get\" name=\"search\" action=\"http:\/\/stores.ebay.com\/"+StoreID+"\">" +
		"		 <input id=\"x-head-srch-bttn\" name=\"submit\" type=\"submit\" value=\"&nbsp\">" +
		"		 <input id=\"x-head-srch-sbox\" onblur=\"if (this.value == '') this.value = 'Search our store...';\" onfocus=\"if (this.value == 'Search our store...') this.value = '';\" value=\"Search our store...\" maxlength=\"300\" name=\"_nkw\"  type=\"text\">" +
		"	<\/form>" +
		"	<!-- head menu links -->" +
		"	<ul id=\"x-head-menu\">" +
		"		<li><a href=\"http:\/\/stores.ebay.com\/"+StoreID+"\">Home<\/a><\/li>" +
		"		<li><a href=\"http:\/\/stores.ebay.com\/"+StoreID+"_W0QQ_sasiZ1\">View All Listings<\/a><\/li>" +
		"		<li><a href=\"http:\/\/stores.ebay.com\/"+StoreID+"\/About-Us\">About Us<\/a><\/li>" +
		"		<li><a href=\"http:\/\/stores.ebay.com\/"+StoreID+"\/Shipping\">Shipping<\/a><\/li>" +
		"		<li><a href=\"http:\/\/stores.ebay.com\/"+StoreID+"\/Payment\">Payment<\/a><\/li>" +
		"		<li><a href=\"http:\/\/stores.ebay.com\/"+StoreID+"\/Refunds\">Refund Policy<\/a><\/li>" +
		"		<li><a href=\"http:\/\/feedback.ebay.com\/ws\/eBayISAPI.dll?ViewFeedback&userid="+UserID+"\">Feedback<\/a><\/li>" +
		"	<\/ul>" +
		"<\/div><\/div>";
	if($(".x-bg").length > 0) { $("#x-head-pull").after(header); }
	
	//Store left column
	var left = "\n\r" +
		"	<!-- left categories menu -->" +
		"	<div id=\"x-side-cats\" title=\"Store Categories\">" +
		"		<div class=\"x-tmid\">" +
		"		 	<ul class=\"lev1\">" +
		"		  		<li><a href=\"http:\/\/stores.ebay.com\/"+StoreID+"_W0QQ_fsubZ1771586011\">CANON<\/a><\/li>" +
		"		 		<li><a href=\"http:\/\/stores.ebay.com\/"+StoreID+"_W0QQ_fsubZ1771588011\">HP<\/a><\/li>" +
		"		 		<li><a href=\"http:\/\/stores.ebay.com\/"+StoreID+"_W0QQ_fsubZ1771589011\">KODAK<\/a><\/li>" +
		"		 		<li><a href=\"http:\/\/stores.ebay.com\/"+StoreID+"_W0QQ_fsubZ3751162011\">XEROX<\/a><\/li>" +
		"		 		<li><a href=\"http:\/\/stores.ebay.com\/"+StoreID+"_W0QQ_fsubZ3751163011\">DELL<\/a><\/li>" +
		"		 		<li><a href=\"http:\/\/stores.ebay.com\/"+StoreID+"_W0QQ_fsubZ3763977011\">SAMSUNG<\/a><\/li>" +
		"		 		<li><a href=\"http:\/\/stores.ebay.com\/"+StoreID+"_W0QQ_fsubZ4300562011\">LEXMARK<\/a><\/li>" +
		"			<\/ul>" +
		"		<\/div><div class=\"x-tbtm\"><!-- sp --><\/div>" +
		"	<\/div>" +
		"	<!-- left newsletter text box -->" +
		"	<div id=\"x-side-news\" title=\"Store Newsletter\">" +
		"		<div class=\"x-tmid\"><div class=\"x-tins\">" +
		"			<p>Add 101toners to your favorite stores and receive our exclusive emails about new items and special promotions!<\/p>" +
		"			<p class=\"x-ckbx\"><input type=\"checkbox\" checked id=\"general\" name=\"nlchxbox\"><label for=\"general\">General Interest<\/label><\/p>" +
		"			<a href=\"http:\/\/my.ebay.com\/ws\/eBayISAPI.dll?AcceptSavedSeller&amp;sellerid="+UserID+"\" id=\"x-side-news-bttn\" title=\"Sign Up\"><!-- sign up --><\/a>" +
		"		<\/div><\/div>" +
		"	<\/div>" +
		"	<!-- left promo graphics -->" +
		"	<img src=\""+ImgURL+"images\/x-side-ppal.png\" class=\"x-prom\" width=\"210\" height=\"98\" alt=\"We accept PayPal\">" +
		"";
	if($(".x-content").length > 0) { $("#x-left-pull").after(left); }
	
	//Store categories population
	if($("#x-side-cats").length > 0) { if($("#LeftPanel .lcat").length > 0) { $("#x-side-cats .x-tmid").html($("#LeftPanel .lcat").html()); } }
	
	//Custom style additions
	if($("#x-head-menu").find("li").length > 0)						{ $("#x-head-menu").find("li:first").addClass("first"); }
	if($("#x-head-menu").find("li").length > 0)	  		  			{ $("#x-head-menu").find("li:last").addClass("last"); }
	if($("#LeftPanel ul.lev1").find("li").length > 0) 				{ $("#LeftPanel ul.lev1").find("li:first").addClass("first"); }
	if($("#LeftPanel ul.lev1").find("li").length > 0)	  				{ $("#LeftPanel ul.lev1").find("li:last").addClass("last"); }
	if($(".x-fp table.fixed").find("tr").length > 0)					{ $(".x-fp table.fixed").find("tr:first td:first").addClass("x-hide"); }
	if($("#x-feat .x-test table.fixed").find("tr").length > 0)	{ $("#x-feat .x-test table.fixed").find("tr:first td:first").removeClass("x-hide"); }
	if($("#x-main-tabs").length > 0)					  					{ $("#x-main-tabs").find("a:first img").addClass("first"); }
	if($("#x-main-tabs").length > 0)										{ $("#x-main-tabs").find("a:last img").addClass("last"); }
	if($("#x-spec").find("table").length > 0)							{ $("#x-spec").find("table tr:last").addClass("last"); }
	
	//Footer with links
	var footer = "\n\r<div id=\"x-foot-wrap\"><div id=\"x-foot\">" +
		"	<div id=\"x-foot-subm\">" +
		"		<a href=\"http:\/\/stores.ebay.com\/"+StoreID+"\">Home<\/a> &nbsp;|&nbsp; " +
		"		<a href=\"http:\/\/stores.ebay.com\/"+StoreID+"_W0QQ_sasiZ1\">View All Listings<\/a> &nbsp;|&nbsp; " +
		"		<a href=\"http:\/\/stores.ebay.com\/"+StoreID+"\/About-Us\">About Us<\/a> &nbsp;|&nbsp; " +
		"		<a href=\"http:\/\/stores.ebay.com\/"+StoreID+"\/Shipping\">Shipping<\/a> &nbsp;|&nbsp; " +
		"		<a href=\"http:\/\/stores.ebay.com\/"+StoreID+"\/Payment\">Payment<\/a> &nbsp;|&nbsp; " +
		"		<a href=\"http:\/\/stores.ebay.com\/"+StoreID+"\/Refunds\">Refund Policy<\/a> &nbsp;|&nbsp; " +
		"		<a href=\"http:\/\/feedback.ebay.com\/ws\/eBayISAPI.dll?ViewFeedback&userid="+UserID+"\">Feedback<\/a>" +
		"	<\/div>" +
		"	<div id=\"x-foot-copy\">Copyright &copy; "+d.getFullYear()+" <a href=\"http:\/\/stores.ebay.com\/"+StoreID+"\">101toners<\/a>. All rights reserved. &nbsp;|&nbsp; <a href=\"http:\/\/www.ocdesignsonline.com\/\" target=\"_blank\">eBay Store Design<\/a><\/div>" +
		"<\/div><\/div>";
	if($(".x-content").length > 0) { $(".x-content").after(footer); }
	if($("#x-template").length > 0) { $("#x-foot").html($("#x-foot").html().replace("eBay Store Design","eBay Templates")); }
	
});

	//Template terms tabs
	var tabs_cur_layer = "x-main-tb01";
	function tabs_swapLayers(id) { if (tabs_cur_layer) tabs_hideLayer(tabs_cur_layer); tabs_showLayer(id); tabs_cur_layer = id; }
	function tabs_showLayer(id) { var layer = tabs_getElemRefs(id); if (layer && layer.css) layer.css.display = "block"; }
	function tabs_hideLayer(id) { var layer = tabs_getElemRefs(id); if (layer && layer.css) layer.css.display = "none"; }
	function tabs_getElemRefs(id) { var el = (document.getElementById)? document.getElementById(id): (document.all)? document.all[id]: (document.layers)? document.layers[id]: null; if (el) el.css = (el.style)? el.style: el; return el; }
	function setSrc(g) {
		if (g==0) { var x=document.images; x["x-tt01"].src="http://farm4.staticflickr.com/3854/14362322182_c73d291a0f_b.jpg" } else { var x=document.images; x["x-tt01"].src="http://farm6.staticflickr.com/5579/14340738526_1a10fc8887_b.jpg" }
		if (g==1) { var x=document.images; x["x-tt02"].src="http://farm6.staticflickr.com/5565/14362322152_95e7674834_b.jpg" } else { var x=document.images; x["x-tt02"].src="http://farm6.staticflickr.com/5560/14340738576_f256eea4a4_b.jpg" }
		if (g==2) { var x=document.images; x["x-tt03"].src="http://farm3.staticflickr.com/2899/14177266280_85fcb001b8_b.jpg" } else { var x=document.images; x["x-tt03"].src="http://farm4.staticflickr.com/3890/14177368047_0b95caec43_b.jpg" }
		if (g==3) { var x=document.images; x["x-tt04"].src="http://farm6.staticflickr.com/5276/14182966388_5b6c259969_b.jpg" } else { var x=document.images; x["x-tt04"].src="http://farm6.staticflickr.com/5233/14368624844_31049aa4e1_b.jpg" }
	}